﻿#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <string.h>
#include <math.h>
#include <unordered_map>
using namespace std;

class Solution {
public:
    vector<vector<int>> merge(vector<vector<int>>& intervals) {
        if (!intervals.size()) return {};
        sort(intervals.begin(), intervals.end());
        int left = 0, right = 0;
        vector<vector<int>> ret;
        for (int i = 0; i < intervals.size(); i++)
        {
            left = intervals[i][0];
            right = intervals[i][1];
            if (!ret.size() || ret.back()[1] < left)
            {
                ret.push_back({ left,right });
            }
            else
            {
                ret.back()[1] = max(ret.back()[1], right);
            }
        }
        return ret;
    }
};


int main()
{
    vector<int> arr(10, 0);
    return 0;
}
